import request from '@utils/request';
import router from '@router';
// request.setInjector(({headers})=>{
//     var token = sessionStorage.getItem('token');
//     token && (headers.token = token);
// });
request.setInjector(({ headers }) => {
    let token = sessionStorage.getItem('token');
    console.log('@config setInject' + new Date().Format('mm:ss'));
    token && (headers.token = token);
  });
request.setReceiver(({response})=>{
    if(response&&response.status==401){
        router.replace('/processor/index');
    }
});
window.request = request;
